import {NgModule} from '@angular/core';
import {IndexComponent} from './index.component';
import {AuthGuard} from '../common/guard/auth.guard';
import {WebSocketComponent} from '../pages/web-socket/web-socket.component';
import {RouterModule, Routes} from '@angular/router';


const routes: Routes = [
    {path: '', redirectTo: 'admin', pathMatch: 'full'},
    {
        path: 'admin',
        component: IndexComponent,
        children: [
            {path: '', redirectTo: 'statistic', pathMatch: 'full'},
            // tslint:disable-next-line:max-line-length
            {path: 'statistic', loadChildren: ()=> import('./statistic-home/statistic-home.module').then(m => m.StatisticHomeModule),canActivate: [AuthGuard]},
            {path: 'webSocket', component: WebSocketComponent,canActivate: [AuthGuard]},
            // tslint:disable-next-line:max-line-length
            {path: 'user-list', loadChildren: ()=>import('./user-list/user-list.module').then(m=>m.UserListModule),canActivate: [AuthGuard]},
        ]
    }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule],
    declarations: []
})


export class IndexRoutingModule {

}
